package mvc;

import java.util.*;
import java.sql.*;

public class Search {
	
	private ArrayList<String> arr = new ArrayList();

public Search(DBconn db, String searchstring) throws SQLException
{
	db.sqlQuery("SELECT username FROM person WHERE username like '%"+searchstring+"%' order by username");

	while(db.next()){		
		this.addSearchResult(db.getString("username"));
	}
}
       
public void addSearchResult(String us) {
	arr.add(us);
}

public Iterator getAllSearchResults(){
	Iterator<String> t = arr.iterator();
	return t;
	}	
}